class Timetable < ApplicationRecord
  belongs_to :course
  belongs_to :company
  belongs_to :store
  belongs_to :classroom
  belongs_to :coach
  belongs_to :instead_coach, class_name: "Coach"
  has_one :promotion, class_name: "ChannelPromotion", foreign_key: :promotion_id
  has_one :coaches_income, :class_name => 'Coaches::Income'
  has_one :admission

  has_many :appointments
  enum status: {refused: 0, ready: 1, assigning: 2, grabbing: 3, released: 4, signed: 5, late: 6, absent: 7, suspended: 8}
  before_save {false}
end
